/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_item_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterItemDetail.findAll", query = "SELECT p FROM PosMasterItemDetail p"),
//    @NamedQuery(name = "PosMasterItemDetail.findBySync", query = "SELECT p FROM PosMasterItemDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterItemDetail.findByItemDetailId", query = "SELECT p FROM PosMasterItemDetail p WHERE p.itemDetailId = :itemDetailId"),
//    @NamedQuery(name = "PosMasterItemDetail.findByItemDetailBarcode", query = "SELECT p FROM PosMasterItemDetail p WHERE p.itemDetailBarcode = :itemDetailBarcode")})
public class PosMasterItemDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "item_detail_id")
    private Integer itemDetailId;
    @Column(name = "item_detail_barcode")
    private String itemDetailBarcode;
    @Column(name = "item_detail_code")
    private String itemDetailCode;
    @Column(name = "item_detail_size")
    private String itemDetailSize;
    @JoinColumn(name = "item_detail_size_id", referencedColumnName = "size_id")
    @ManyToOne
    private PosMasterSize itemDetailSizeId;
    @JoinColumn(name = "item_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private PosMasterItem itemDetailItemId;

    public PosMasterItemDetail() {
    }

    public PosMasterItemDetail(Integer itemDetailId) {
        this.itemDetailId = itemDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getItemDetailId() {
        return itemDetailId;
    }

    public void setItemDetailId(Integer itemDetailId) {
        this.itemDetailId = itemDetailId;
    }

    public String getItemDetailBarcode() {
        return itemDetailBarcode;
    }

    public void setItemDetailBarcode(String itemDetailBarcode) {
        this.itemDetailBarcode = itemDetailBarcode;
    }

    public String getItemDetailCode() {
        return itemDetailCode;
    }

    public void setItemDetailCode(String itemDetailCode) {
        this.itemDetailCode = itemDetailCode;
    }

    public PosMasterSize getItemDetailSizeId() {
        return itemDetailSizeId;
    }

    public void setItemDetailSizeId(PosMasterSize itemDetailSizeId) {
        this.itemDetailSizeId = itemDetailSizeId;
    }

    public PosMasterItem getItemDetailItemId() {
        return itemDetailItemId;
    }

    public void setItemDetailItemId(PosMasterItem itemDetailItemId) {
        this.itemDetailItemId = itemDetailItemId;
    }

    public String getItemDetailSize() {
        return itemDetailSize;
    }

    public void setItemDetailSize(String itemDetailSize) {
        this.itemDetailSize = itemDetailSize;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemDetailId != null ? itemDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterItemDetail)) {
            return false;
        }
        PosMasterItemDetail other = (PosMasterItemDetail) object;
        if ((this.itemDetailId == null && other.itemDetailId != null) || (this.itemDetailId != null && !this.itemDetailId.equals(other.itemDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosMasterItemDetail[ itemDetailId=" + itemDetailId + " ]";
    }
    
}
